package com.itcv.mybatis.demo;

import com.itcv.mybatis.demo.dao.StudentMapper;
import com.itcv.mybatis.demo.model.Student;
import com.itcv.mybatis.demo.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

/**
 * 一对一级联测试
 */
public class BindSqlTest {

    public static void main(String[] args) {
        SqlSession sqlSession = null;
        try {
            sqlSession = SqlSessionFactoryUtil.openSqlSession();
            StudentMapper studentMapper = sqlSession.getMapper(StudentMapper.class);
              System.out.println(studentMapper.getStudent(1));
           // System.out.println(stu.getStudentSelfcard().getNativeAddress());
          /*  List<StudentLecture> studentLectureList = stu.getStudentLectureList();
            for (StudentLecture studentLecture :studentLectureList){
                System.out.println(studentLecture.getLecture().getLectureName());
            }*/
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            sqlSession.close();
        }
    }
}
